<template>
  <div>
    <h3>物料需求列表</h3>
    <el-table :data="materialDemandList">
      <el-table-column prop="materialCode" label="物料编码" />
      <el-table-column prop="materialName" label="物料名称" />
      <el-table-column prop="quantity" label="需求数量" />
      <el-table-column prop="unit" label="单位" />
    </el-table>
  </div>
</template>

<script setup>
import {ref, onMounted} from 'vue';
import { getBomList } from '@/api/production-order';

// 模拟数据（无需后端接口）
const materialDemandList = ref([
  {materialCode: 'MAT001', materialName: '螺丝', quantity: 100, unit: '个'},
  {materialCode: 'MAT002', materialName: '螺母', quantity: 100, unit: '个'},
  {materialCode: 'MAT003', materialName: '垫片', quantity: 200, unit: '片'},
]);

// 注释掉接口调用，直接使用模拟数据
// onMounted(() => {
//   getMaterialDemandList().then(res => {
//     materialDemandList.value = res.data;
//   });
// });
</script>